<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="yNav" id="yNav">
	<c:forEach var="parent" items="${growCycleSegments.children}" varStatus="parentStatus">
		<c:set var="childrenSize" value="${fn:length(parent.children)}"/>
		<c:if test="${parentStatus.count == 1}">
			<c:set var="childrenWidth" value="22"/>
		</c:if>
		<c:if test="${parentStatus.count == 2}">
			<c:set var="childrenWidth" value="440"/>
		</c:if>
		<c:if test="${parentStatus.count == 3}">
			<c:set var="childrenWidth" value="44"/>
		</c:if>
		<c:if test="${parentStatus.count == 4}">
			<c:set var="childrenWidth" value="132"/>
		</c:if>
		<c:if test="${parentStatus.count == 5}">
			<c:set var="childrenWidth" value="250"/>
		</c:if>
		<c:if test="${parentStatus.count == 6}">
			<c:set var="childrenWidth" value="44"/>
		</c:if>
		<div class="bk bk${parentStatus.count-1}" style="width:${childrenWidth + 4}px;">
			<div class="" style="width:${childrenWidth}px">
				<c:set var="ulWidth" value="${childrenSize * 11}"/>
				<c:if test="${childrenSize==1}">
					<c:set var="ulWidth" value="22"/>
				</c:if>
				<ul style="width:${ulWidth}px">
					<c:forEach var="current" items="${parent.children}" varStatus="parentStatus">
					<c:if test="${childrenSize==1}">
					<li>
						<a target="_blank" tit="${current.current.title}" href="<c:url value='/growcycle/view.do?segid=${current.current.segmentid}'/>">
							${current.current.title}
						</a>
					</li>
					</c:if>
					<li>
						<a target="_blank" tit="${current.current.title}" href="<c:url value='/growcycle/view.do?segid=${current.current.segmentid}'/>">
							${current.current.title}
						</a>
					</li>
					</c:forEach>
				</ul>
			</div>
			<p>
				<a class="color:red" target="_blank" href="<c:url value='/growcycle/view.do?segid=${parent.current.segmentid}'/>">
				<c:out value="${parent.current.title}"/>
				</a>
			</p>
		</div>
	</c:forEach>
</div>
<script type="text/javascript" src="${ctx}/scripts/timeline.js"></script>